$(function(){
    return new Promise((resolve,reject)=>{
        $.get('http://localhost:4000/product',data=>{
            data.forEach(tem => {
                let html=`
                <tr class="pow">
                <td>${tem.id}</td>
                <td>${tem.biaoti}</td>
                <td>${tem.zhaiyao}</td>
                <td>${tem.neirong}</td>
                <td>${tem.fenlel}</td>
                <td>${tem.zuozhe}</td>
                <td>${tem.time}</td>
              <td></td><input type="button" value="编辑" onclick="bianji(${tem.id}">
              <input type="button" value="取消" onclick="bianji(${tem.id}"></td>
            </tr>`;
                $('#ml').append(html);
                
            });
        })
    })
})

function shanchu(id){
    $.get(`http://localhost:4000/producthh/${id}`,(data)=>{
        window.location.href='index.html';
    })
}
function add(){
    window.location.href='add.html'
}
function baocun(){
    window.location.href='index.html'
}
function quxiao(){
    window.location.href='index.html'
}